<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<script>
// + 当有一个运算符是字符串的时候, 就是字符串连接符
var a = 10
var b = "20";
console.log(a + +b + 30);

// -  undefined - > NaN null -> 0
console.log(a - b - true - null);

console.log("10" * 3)

console.log(10 / 3)

// %  取余 取模   余数的符号和被除数一致
console.log(-10 % -3)

// 计算出来一个3位数上的各位数字的和 123
var n = 6249;
var ge = n % 10;
var shi = parseInt(n / 10) % 10;
var bai = parseInt(n / 100) % 10
var qian = parseInt(n / 1000)
console.log(ge + shi + bai + qian);
</script>
</body>
</html>